package com.ty.utils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class PermissionUtils {
    public static boolean hasAdminPermission(HttpServletRequest request) {
        HttpSession session = request.getSession(false);
        if (session != null) {
            Integer permission = (Integer) session.getAttribute("permission");
            return permission != null && permission == 1;
        }
        return false;
    }
}